<include file="Public:header" />
    <h3 class="title"><em>网站列表</em><span><a href="{:U('add')}">+新增</a></span><span><a href="{:U('Webapply/index')}">审核列表&nbsp;&rsaquo;&nbsp;</a></span></h3>
	<div class="listbox">
        <form name="mform" method="post" action="{:U('index')}">
		<div class="search">
			<span>名称：</span><input name="name" type="text" id="name" class="ipt" size="30" value="{$pageInfo['name']}" />
            <select name="cate_id" id="cate_id" class="sel">
                <option value="">所有分类</option>
                {$cateOption}
			</select>
            <script type="text/javascript">
			$(function(){
				$("#cate_id").val("{$pageInfo['cate_id']}");	
			});
			</script>
            <select name="status" id="status" class="sel">
                <option value="">所有状态</option>
                <foreach name="statusArray" item="v" key="k">
                <option value="{$k}">{$v}</option>
                </foreach>
			</select>
            <script type="text/javascript">
			$(function(){
				$("#status").val("{$pageInfo['status']}");	
			});
			</script>
            <select name="attr" id="attr" class="sel">
                <option value="">属性</option>
                <option value="is_best">推荐</option>
                <option value="is_top">置顶</option>
                <option value="is_pay">付费</option>
			</select>
            <script type="text/javascript">
			$(function(){
				$("#attr").val("{$pageInfo['attr']}");	
			});
			</script>
			<input type="submit" class="btn" value="搜索" />
        </div>
        </form>
        
        <form name="mform" method="post" action="{:U('doAction')}">
    	<div class="toolbar">
			<select name="act" id="act" class="sel">
			<option value="delAll" style="color: #f00;">删除选定</option>
			<option value="setStatus">设置状态</option>
			</select>
            <select name="status" class="sel" id="setStatus" style="display:none;">
                <foreach name="statusArray" item="v" key="k">
                <option value="{$k}">{$v}</option>
                </foreach>
			</select>
			<input type="submit" class="btn" value="应用" onClick="if(IsCheck('id[]')==false){alert('请指定您要操作的ID！');return false;}else{return confirm('确认执行此操作吗？');}">
		<script type="text/javascript">
			$(function(){
				$("#act").change(function(){
					var thisAction = $(this).val();
					if(thisAction == 'setStatus'){
						$("#setStatus").show();	
					}else{
						$("#setStatus").hide();	
					}
				});	
			});
		</script>
        </div>
        <table width="100%" border="0" cellspacing="1" cellpadding="0">
			<tr>
				<th><input type="checkbox" id="ChkAll" onClick="CheckAll(this.form)">选择</th>
				<th>网站标题</th>
				<th>分类</th>
				<th>加入时间</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
			
            <empty name="list">
			<tr><td colspan="8">无任何数据！</td></tr>
            <else/>
            	<volist name="list" id="row">
                <tr>
                    <td><input name="id[]" type="checkbox" value="{$row['id']}">{$row['id']}</td>
                    <td style="text-align:left;">{$row['name']}<br />{$row['url']}</td>
                    <td>{$categoryTextArray[$row['cate_id']]}</td>
                    <td>{:date('Y-m-d', $row['add_time'])}</td>
                    <td>{$statusArray[$row['status']]}</td>
                    <td><a href="{:U('edit', array('id'=>$row['id']))}">编辑</a> | <a href="{:U('del', array('id'=>$row['id']))}" onclick="return confirm('你确定删除吗?');">删除</a></td>
                </tr>
                </volist>
            </empty>
		</table>
		</form>
        <include file="Public:page" />
	</div>
<include file="Public:footer" />
